function userList(){
	var id="Sys-userList";
	var imgUrl=false;
	var store=new Ext.data.Store({
		reader:new Ext.data.JsonReader({
			root:'data',
		    fields: ['name','user_photo','email','sex',{ name : 'register_time', type : 'date', dateFormat : 'timestamp' } ]
		}),
		proxy : new Ext.data.HttpProxy({
		    method: 'post',
		    url: Fn.url("User/user?cmd=list")
		}),		
		autoLoad:true
	});
	var uploadTmpUrl=false;  //临时地址
	
	var print=function(win){
		//focus();
	    document.getElementById(win).contentWindow.window.print();
	};
	
	var printView=function(cfg){
		new Ext.Window({
			id:"print_window",
			title:cfg.title||'打印预览',
			tbar:[{
				xtype:"button",
				icon:Fn.img('icon-print.png'),
				text:"打印",
				handler:function(){
				document.getElementById("printArea").contentWindow.window.print();
				}
			}],
			width:800,
			html:'<iframe id="printArea" name="printArea" src="'+cfg.url+'" width="100%" height="100%" frameborder="0"></iframe>'
		}).show();
	};
	
	
	//对查询、下载的方法进行的封装
	var csv=function(way){
		var user=Ext.getCmp("App-Js-userList-searchUser").getValue();
		var sex=Ext.getCmp("App-Js-userList-searchSex").lastSelectionText;
		var beginTime=Ext.getCmp('App-Js-userList-beignTime').getValue();
		var endTime=Ext.getCmp("App-Js-userList-endTime").getValue();
		if(way=="search"){
			store.setBaseParam("textField",user);//该store就是主grid的store,设置参数传递到数据端
			store.setBaseParam("sex",sex);
			store.setBaseParam("beginTime",beginTime);
			store.setBaseParam("endTime",endTime);
			store.setBaseParam("way",way);
			store.load();
		}
		if(way=="down"){
			Ext.Ajax.request({
				url:Fn.url("User/user?cmd=list"),
				method:"post",
				params:{
					textField:user,
					sex:sex,
					beginTime:beginTime,
					endTime:endTime,
					way:way
				},
				success:function(response){
					var response=Ext.util.JSON.decode(response.responseText);
					window.open(response.fileName);
				}
			})
		}
	};
	var cm = new Ext.grid.ColumnModel([
	     { header: "name",dataIndex:'name', width: 60},
	     { header: "sex",dataIndex:'sex', width: 150}
	]);
	
	//复选框
    var checkBox=new Ext.grid.CheckboxSelectionModel({
        singleSelect:false,
        checkOnly: false
    });
    //给列表的用户性别加点颜色区分
    var sex=function(value){  
		if(value=="男")  
		    return '<span style="color:red;">'+value+'</span>';  
	    else  
		    return  '<span style="color:green;">' + value + '</span>'; 		       
    };
    
    //编辑表格
    var editor=new Ext.form.TextField({
        allowBlank: false
    });
    
    //下拉框
    var combo= new Ext.form.ComboBox({
    	typeAhead: true,
	    triggerAction: 'all',
	    editable:false,
	    lazyRender:true,
	    mode: 'local',
	    store: new Ext.data.ArrayStore({
	        id: 0,
	        fields: [
	            'myId',
	            'displayText'
	        ],
	        data: [['女', '女'], ['男', '男']]
	    }),
	    valueField: 'myId',
	    displayField: 'displayText'
    });
    
    var comBoxData= new Ext.form.ComboBox({
    	typeAhead: true,
	    triggerAction: 'all',
	    //editable:false,
	    lazyRender:true,
	    mode: 'local',  
	    store:new Ext.data.ArrayStore({
	    	id:"App-Js-userList-edit-excel-store",
	    	fields:['value','text'],
	        data:[]
	    }),
	    valueField:'value',
	    displayField:'text'
    });
    //文件导入窗口
    var gridWindow=new Ext.Window({
    	title:"文件导入",
    	closeAction:"hide",
    	modal:true,
    	resizable:false,
    	width:600,
    	height:400,
    	layout:'fit',
    	buttons:[{
    		text:"确定",
    	    handler:function(){
    	    	//alert(uploadTmpUrl);return;
    	    	var gridPanel=Ext.getCmp('App-JS-userList-Panel-grid');
    			var editorGrid=Ext.getCmp("App-Js-userList-window-grid-editor");
    			var items=editorGrid.store.data.items;
    			//var a=uploadTmpUrl;
    			//Fn.log(items);
				var excelMysql = [];
				for(var  i=0;i<items.length;i++){
					excelMysql[i]=items[i].data;
				}
				//Fn.log(excelMysql);//[Object, Object, Object, Object]
				//return;
				var excelData=Ext.util.JSON.encode(excelMysql);//[{"number":"A","fieldName":"姓名","sysField":"name"},{"number":"B","fieldName":"性别","sysField":"sex"}]
				if(excelMysql){
					Ext.Ajax.request({
						url: Fn.url("Excel/excel?cmd=loadExcel"),
						params:{
							excelData:excelData,
							url:uploadTmpUrl
						},
						success:function(data){
							if(data.success==false){
								Ext.Msg.alert("提示信息", "<font color='red'>添加失败</font>"); 
							} 
							else {            
								Ext.Msg.alert("提示","添加成功!!!"); 
								gridPanel.getStore().load();
								gridWindow.hide();
                            }  
						}
				   })
               }
    		}
    	}],
    	items:[{
    		xtype:'editorgrid',
    		id:"App-Js-userList-window-grid-editor",
    		store:new Ext.data.Store({
      			reader:new Ext.data.JsonReader({
      				root:'userData',
      			    fields: ['number','fieldName','sysField']
      			})
      	    }),
      	    viewConfig:{
      	    	forceFit:true
      	    },
			columns:[
			    {header:'序号',dataIndex:'number'},
	          	{header:'excel导入标题字段',dataIndex:'fieldName'},
	          	{header:'系统识别字段',dataIndex:'sysField',editor:comBoxData}
	        ]    	
	    }]
    });
    
    //上传excel表格数据到grid
    var uploadExcel=new Ext.Window({
    	title:"上传excel文件",
    	closeAction:"hide",
    	modal:true,
    	resizable:false,
    	width:500,
    	height:200,
    	layout:"fit",
    	buttons:[{
    		text:"上传excel",
    		handler:function(){
    			var form=Ext.getCmp("App-JS-userList-upload-excel");
				var grid=Ext.getCmp('App-JS-userList-Panel-grid');
				var gridEditor=Ext.getCmp('App-Js-userList-window-grid-editor');
				var wins=gridWindow.show();
				//grid.reconfigure(store,cm);return;//生成动态表格
				form.getForm().submit({ //submit方法提交数据
        			method:"POST",
        			url: Fn.url('Excel/excel?cmd=uploadExcel'),
					success:function(data,response){
						var ajaxResponse=response.response.responseText;
						var response=Ext.util.JSON.decode(ajaxResponse);
						//Fn.log(response);return;
					    var comboExcel=response.comboExcel;
					    var result=comboExcel.excelCombo;
					    //Fn.log(result);return;//[Array[2], Array[2], Array[2], Array[2]]
					    uploadTmpUrl=response.filename;//给临时地址变量赋值，其他方法都可以调用
						if(response.success==false){
							Ext.Msg.alert("提示信息", "<font color='red'>上传excel文件失败</font>"); 
						} 
						else {
							uploadExcel.hide();
							gridEditor.getStore().loadData(response.data);
							var aaa=comBoxData.getStore();							
							comBoxData.getStore().loadData(result);
							
                        }  
					}
			   })
    		}
    	},{
    		text:"下载模板",
    		handler:function(){
    			var form=Ext.getCmp("App-JS-userList-upload-excel");
				var grid=Ext.getCmp('App-JS-userList-Panel-grid');
				form.getForm().submit({ //submit方法提交数据
        			method:"POST",
        			//url: Fn.url('Excel/excel?cmd=goods_export'),
        			url:Fn.url('User/user?cmd=export_template'),
					success:function(data,response){
						var ajaxResponse=response.response.responseText;
						var response=Ext.util.JSON.decode(ajaxResponse);
						if(response.success==false){
							Ext.Msg.alert("提示信息", "<font color='red'>下载excel失败</font>"); 
						} 
						else { 
							uploadExcel.hide();
							window.open(response.fileName);
                        }  
					}
			   })
    		}
    	}],
    	items:[{
    		xtype:'form',
    		id:"App-JS-userList-upload-excel",
    		fileUpload:true,
    		padding:10,
    		items:[{
    			xtype:'textfield',
                name:'excelUpload',  
                inputType:"file",
                fieldLabel:'excel文件',
                anchor:'98%'
    		}]
    	}]
    });
				
    //上传、修改用户头像
    var uploadPho=new Ext.Window({
    	title:"用户头像",
    	closeAction:"hide",
    	modal:true,
    	resizable:false,
    	width:500,
    	height:200,
    	layout:"fit",
    	buttons:[{
    		text:"确定",
    		handler:function(){
    			var form=Ext.getCmp("App-JS-userList-upload-userPhoto-form");
				var grid=Ext.getCmp('App-JS-userList-Panel-grid');
				var rec = grid.getSelectionModel();
				var selectedRecord=rec.grid.selModel.selections.items;
				if(selectedRecord.length > 0){
					var userIds = [];
					for(var i=0;i<selectedRecord.length;i++){
						userIds[i] = selectedRecord[i].id;
					}
				}
				form.getForm().submit({ //submit方法提交数据
        			method:"POST",
        			url: Fn.url('User/user?cmd=uploadPho&userIds='+userIds),
					success:function(data){ 
						Ext.Msg.alert("提示","头像编辑成功!!!");
						grid.getStore().load();     
						uploadPho.hide();
					}
			   })
    		}
    	}],
    	items:[{
    		xtype:'form',
    		id:"App-JS-userList-upload-userPhoto-form",
    		fileUpload:true,
    		padding:10,
    		items:[{
    			xtype:'textfield',
                name:'userPhoto',  
                inputType:"file",
                fieldLabel:'Photo',
                anchor:'98%'
    		}]
    	}]
    });
    
    var print=new Ext.Window({
    	width:600,
    	height:200,
    	title:"打印user属性",
    	buttons:[{
    		text:"打印",
    		handler:function(){
    			var attr=Ext.getCmp("printProductForm_combo").getValue();////通过form只能得到combox的表面值，不能得到其value值
    			var form=Ext.getCmp("printProduct_form").getForm().getValues();
    			//Fn.log(attr);//02
    			//Fn.log(form);//Object {ID: "12345", attr: "灰色", number: "123"}
    			if(form['number']=='' || attr==""){
					alert("不能为空，必须都填写");
					return;
				}
				printView({
					url:Fn.url("User/user?cmd=print&id="+form['ID']+'&attr='+attr+'&number='+form['number'])
				})
    		}
    	}],
    	layout:"fit",
	    items:[{
			xtype:'form',
			id:'printProduct_form',
			labelWidth:50,
			padding:30,
			layout:'fit',
			items:[{
				layout:'column',
				border:false,
				padding:10,
				items:[{
					columnWidth:.3,
					layout:'form',
					border:false,
					items:[
						{
						xtype:"textfield",
						name:"ID",
						fieldLabel:"产品ID",														
						value:"12345",
						width:100,
						readOnly:true
						}
					]
				},{
					columnWidth:.3,
					layout:'form',
					border:false,
					items:[
					 	new Ext.form.ComboBox({
							editable:false,
						    id:'printProductForm_combo',
							fieldLabel:"属性",
							width:100,
							name:"attr",
							store:new Ext.data.ArrayStore({
								fields:['myId','displayText'],
								data:[["01","蓝色"],["02","灰色"],["03","红色"]]
							}),
							mode: 'local',
							triggerAction: 'all',
							displayField: 'displayText',
							valueField: 'myId'
						})
					] 
				},{
					columnWidth:.3,
					layout:'form',
					border:false,
					items:[{
						xtype:"textfield",
						fieldLabel:"数量",
						width:100,
						name:"number",
						listeners:{
							change:function(textField,newValue,oldValue){
								var valueText= parseInt(parseFloat(newValue));
								if(isNaN(valueText)|| valueText<=0){
									alert("必须输入大于0的整数类型");
								}
							}
						}
				    }]
				}]
			}]								
		}]
    })
    
    var winId="App-Js-userList-addUser-Window";
    var formId=winId+"_addForm";
    //添加用户窗口
    var addUserWin=new Ext.Window({
    	closeAction:'hide', //window调用的关闭方式是hide,不是close
    	modal:true,
    	resizable:false,
    	id:winId,
		title:'添加用户',
 	    width:450,
 	    layout:'fit',
        height:250,
        buttons:[{
        	text:'提交',
        	handler:function(){
        		var grid=Ext.getCmp("App-JS-userList-Panel-grid");
        		//extjs3是通过组件id来获取组件值的
        		var userAddForm=Ext.getCmp("formId");
        		var data = userAddForm.getForm().getValues();
        		var img=Ext.getCmp("App-JS-userList-addUser-upload");
        		var name=img.name;
        		var img_url=img.getValue();//得到的是上传的路径
        		var type = img_url.substring(img_url.length - 3).toLowerCase();  //上传文件的类型
//        		if (img_url == "" || img_url == null) {  
//                    return;  
//                }
        		if(img_url){
	                if (type != 'jpg' && type != 'bmp' && type != 'gif' && type != 'png' && type!='jpeg') {  
	                    alert('仅支持jpg、bmp、gif、png、jpeg格式的图片');  
	                    return;  
	                } 
        		}
        		userAddForm.getForm().submit({ //submit方法提交数据
        			method:"POST",
        			url: Fn.url('User/user?cmd=addUser'),
          		   /* params:{
          		 	   data:data 	   
          		    },*/
        			success:function(data,response){
        				Ext.Msg.alert('Success', response.result.msg);
      	        		grid.getStore().load();
      	        		userAddForm.getForm().reset();
          	        },
        			failure: function(data,response) {
						Ext.Msg.alert('Failure', response.result.msg);
        			}
          	   })
        	}
        		//ajax方法提交数据
//        		var formValue=userAddForm.getForm().getValues();
//        		if(userAddForm.getForm().isValid()){
//	        		var data = userAddForm.getForm().getValues();
//	        		//Fn.log(data);//data得到的是一个对象
//	        		//注意此处需要对每个定义一个name属性以便获取其值
//	        		var name=data.name;
//	        		var password=data.password;
//	        		var email=data.email;
//	        		var sex=data.sex;
//	        		if(data){
//	             	   Ext.Ajax.request({
//	             		   url: Fn.url('User/user?cmd=addUser'),
//	             		   method:'post',
//	             		   params:{
//	             			   sex:sex,
//	             			   name:name,
//	             			   password:password,
//	             			   email:email
//	             		   },
//	             		   success:function(response){
//	             			// Fn.log(response);
//	             			// Fn.log(response.responseText );结果为{"success":false,"msg":2222}
//	             			//Fn.log(response.responseText.success);结果为undefined，所以该response.responseText为字符串
//	             			//response.responseText为一个字符串，decode可以将字符串转变为对象
//	             			 var response=Ext.util.JSON.decode(response.responseText);//Ext.decode该方法也可以
//	             			 if(response.success==false){
//										Ext.Msg.alert("提示","该邮箱已注册...");
//	             		     } else {
//										Ext.Msg.alert("提示","添加成功!!!");
//										grid.getStore().load();
//										userAddForm.getForm().reset();//方法一
//										
////										Fn.log(formValue);
////										for(var v in formValue){
////											formValue[v]='';
////										}
////										userAddForm.getForm().setValues(formValue);//方法二
//										
////										Ext.getCmp('App-JS-userList-addUser-name').setValue();//方法三
////										Ext.getCmp('App-JS-userList-addUser-email').setValue();
////										Ext.getCmp('App-JS-userList-addUser-sex').setValue("女");
////										Ext.getCmp('App-JS-userList-addUser-password').setValue();
//							 }
//	             	       }
//	             	   })
//	        		}
//        		}else{
//        			Ext.Msg.alert("提示信息", "<font color='red'>输入框不能为空</font>"); 
//        		}
//        	}
        }],
        items:[{
        	xtype:'form',
        	padding:10,
        	fileUpload:true,//上传文件必不可少的属性
        	id:'formId',
        	items:[{
        		fieldLabel:'name',
        		id:'App-JS-userList-addUser-name',
        		labelWidth:70,
        		xtype:'textfield',
        		name:"name",
        		anchor:'97%',
        		value:"",
        		labelAlign:'right',
				allowBlank:false,
				blankText:"用户名必须输入"
        	  },{
        		fieldLabel:'password',
        		id:'App-JS-userList-addUser-password',
        		anchor:'97%',
        		inputType:'password',
        		xtype:'textfield',
        		name:"password",
        		value:"",
        		minLength:3,
				minLengthText:"密码长度不能小于3",
				maxLength:12,
				maxLengthText:"密码长度不能大于{0}",
				allowBlank:false,
        		labelAlign:'right'
              },{
        	    xtype: 'combo',
        	    id:"App-JS-userList-addUser-sex",
        	    anchor:'97%',
                fieldLabel: 'sex',
                editable:false,
                margin:"5 0 5 20",
                store: new Ext.data.ArrayStore({
                   fields: ['value', 'text'],
                   data: [['woman','女'], ['man','男']]
                }),
                name: 'sex',
                mode: 'local',//加载本地数据,不可省略
                triggerAction: 'all',//点击触发时执行操作,不可省略
                value:'woman',
                displayField: 'text',
                valueField: 'value',
       		    labelAlign:'right'
              },{
            	xtype:'textfield',
            	id:"App-JS-userList-addUser-email",
                regex: /^\s*\w+([-+."]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*(\;\w+([-+."]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*(\;)*\s*$/,
                regexText: "邮箱的格式无效",
            	fieldLabel:'email',
            	anchor:'97%',
            	name:"email",
            	allowBlank:false   
             },{
            	xtype:'textfield',
            	id:'App-JS-userList-addUser-upload',  
                name:'upload',  
                inputType:"file",
                fieldLabel:'Photo', 
                anchor:'97%'
           }]
        	
        }]
	});
    
   
    //主面板(分为上下俩部分)
	var panel=new Ext.Panel({
		title:'用户列表',
		closable:true,
		id:id,
		layout:'border',
		//layout:'fit',
		fileUpload:true,
		tbar:[
			new Ext.form.TimeField({
			    minValue: '0:00 AM',
			    maxValue: '0:00 PM',
			    increment: 1,//表示单位是三十分钟
			    width:100
			}),
		    new Ext.form.TwinTriggerField({
				trigger1Class:'x-form-clear-trigger',
				trigger2Class:'x-form-search-trigger',
				id:id+'-search-text-field', 
			    enableKeyEvents:true,
				hideTrigger1:true,
				listeners:{keyup:function(f,e){//判断是否按”enter“键
					if(e.getCharCode()===13) f.xSearchFn();
				}},
				onTrigger1Click:function(e){//这个就是按”搜索图标“所触发的方法
					if(this.hasSearch){
						this.el.dom.value = '';
						this.triggers[0].hide();  
						this.hasSearch = false;
						store.setBaseParam('ProdId','');
						store.reload();
					}
				},
				onTrigger2Click:function(e){this.xSearchFn();},
				xSearchFn:function(){
					//当enter键回车后，进入该函数
					var v = this.getRawValue();//v为输入的值
					if(v || false){
						this.hasSearch = true;
						this.triggers[0].show();
					}
					store.setBaseParam('ProdId',v);
					store.reload();
			    }
		  }),/*'-',{
		    	xtype:"numberfield",
		    	fieldLabel:"数量"
		  },*/
		  {
			text:'<span style="color:red">添加用户</span>',
			handler:function(){
				var win=addUserWin.show();
			}
		  },'-',{
			 text:"<span style='color:red'>删除用户</span>",
			 handler:function(){
				 var gridPanel=Ext.getCmp('App-JS-userList-Panel-grid');
				 var rec = gridPanel.getSelectionModel();
				 var selectedRecord=rec.grid.selModel.selections.items;
				 var name=document.getElementById('sessionName').getAttribute("value");
				 //Fn.log(selectedRecord[0]);
				 if(selectedRecord.length > 0){
					var userIds = [];
					for(var i=0;i<selectedRecord.length;i++){
						userIds[i] = selectedRecord[i].id;
					}
				    //Fn.log(userIds[0]);
					Ext.MessageBox.confirm("提示信息", "确定要删除吗？",function(but){
		 				if(but == 'yes' ){
							if(userIds){
								Ext.Ajax.request({
									method: 'post',
									url: Fn.url("User/user?cmd=delButton&userIds="+userIds+"&userName="+name),
									success:function(data){
										var rec=Ext.util.JSON.decode(data.responseText);
										if(rec.success==false){
											Ext.Msg.alert("提示信息", "<font color='red'>权限不够</font>"); 
										} 
										else {            
											Ext.Msg.alert("提示","删除成功!!!");
											gridPanel.getStore().load();       
	                                    }  
									}
								})
	                       }
		 			   }
					})
				 }
			 }
		  },'-',{
			xtype:'textfield',
			emptyText: '用户名',
			id:"App-Js-userList-searchUser",
			width:50
			
			//这种方法只能够搜索该页下的数据，不能进行对整体数据的搜索
//			listeners:{
//  	        	change:function(formField,newValue,oldValue ){
//  	        		//alert(1);
//  	        		var userName=newValue;
//  	        		var grid=Ext.getCmp("App-JS-userList-Panel-grid");
//  	        		var store=grid.getStore();
//  	        		//Fn.log(1);
//  	        		//Fn.log(userName);
//  	             	store.clearFilter(true);
//  	          	    store.filterBy(function(record,id){
//  	          	    	var name=record.data.name;
//  	          	        //Fn.log(record.get('name'));
//		          	    if(!userName){//先进行判断
//		          	    	// Fn.log(2222222);
//		          			 return true;
//		          		}
//		       			if(record.get('name')==userName){
//		       				 return true;
//		       			}else{
//		       				 return false;
//		       			}
//  	      	       });
//  	        	}
//  	        }
		},'-',' ',{
			xtype:"combo",
			id:"App-Js-userList-searchSex",
			width:50,
			store:new Ext.data.ArrayStore({
				fields:['value','text'],
				data:[['woman','女'],['man','男']]
			}),
			mode: 'local',
			triggerAction: 'all',
            value:'女',
            emptyText:"性别",
            displayField: 'text',
            valueField: 'value'
		},'-',' ',{
			xtype:"datefield",
			id:"App-Js-userList-beignTime",
			width:100,
			emptyText:"开始时间",
			format:"Y/m/d"
		},'-',' ',{
			xtype:"datefield",
			width:100,
			id:"App-Js-userList-endTime",
			emptyText:"结束时间",
			format:"Y/m/d"
		},{
			text:"查询",
			handler:function(){
                csv("search");				
			}
		},'-',{			
			text:"下载",
			handler:function(){
				csv("down");				
			}
		},'-',{
			text:"打印",
			handler:function(){
				print.show();
			}
		},'-',{
			 text:"发送邮件",
			 handler:function(){
				 Ext.Ajax.request({
            		 method: 'post',
            		 url: Fn.url("User/user?cmd=sendMail"),
            		 success:function(r){
            			// Fn.log(r);
            			 var rec=Ext.util.JSON.decode(r.responseText);
            			 if(rec.success==false){
            				 Ext.Msg.alert("提示信息", "<font color='red'>发送失败</font>"); 
            		     } 
            			 else {            
            				 Ext.Msg.alert("提示","发送成功!!!");
                         }  
            	     }
                 })
			 }
		},'->',{			
			text:"上传/修改头像",
			handler:function(){
				var photoWin=uploadPho.show();
			}
		},'-','',{
			text:"excel文件上传/下载",
			handler:function(){
				var excelWin=uploadExcel.show();
			}
		},{
			//设置只有勾选了该按钮，单击面板时右端面板才会自动展开，不然点击右侧的伸缩部分
			xtype:'checkbox',
			boxLabel:'是否显示详情',
			value:1,
			id:'userList_panel_tbar_checkbox_html',
			listeners:{
				change:function(t,n,o,e){
					if(n){
						Ext.getCmp('userList_east_infoHtml').expand(true);
					}else{
						Ext.getCmp('userList_east_infoHtml').collapse();
					}
				}
			}
		}],
	    items:[
          { /******
             上部分
              *****/
        	 xtype:'editorgrid',
        	 id:"App-JS-userList-Panel-grid",
        	 region:"center",
        	 layout:'fit',
        	 //draggable:true,
        	 //height:600,
        	 listeners:{
        			afteredit:function(e){
        				//Fn.log(e);
        				var nowValue=e.value;
        				var originalValue=e.originalValue;
        				var id=e.record.id;
        				var grid=Ext.getCmp("App-JS-userList-Panel-grid");
        				if(id){
        					Ext.Ajax.request({
        						url: Fn.url('User/user?cmd=editorUser'),
        						method:'post',
        						params:{
        							id:id,
        							nowValue:nowValue,
        							originalValue:originalValue
        						},
        						success:function(response){
        							var response=Ext.util.JSON.decode(response.responseText);
        							if(response.success==false){
        								Ext.Msg.alert("提示","编辑不成功...");
        							} else {
        								Ext.Msg.alert("提示","编辑成功!!!");
        								grid.getStore().load();
        							}
        						}
        					})
        	        	}
        			},
	         	    afterrender:function(t,e){
	         			Ext.fly(t.id).on('click',function(e,t){
	         				var url=t.getAttribute("imageUrl");//得到头像的地址
//	         				document.getElementById("showimg").src = url; //图片路径
//	         				//document.getElementById("spanimg").innerHTML = url; 
//	         				var v = document.getElementById('divCenter'); //得到浮动层
//	         				v.style.display = "block";
	         				var gridPanel=Ext.getCmp('App-JS-userList-Panel-grid');
		         			var rec = gridPanel.getSelectionModel();
	        				var selectedRecord=rec.grid.selModel.selections.items;
	        				if(selectedRecord.length > 0){
	        						var userId = [];
	        						for(var i=0;i<selectedRecord.length;i++){
	        							userId = selectedRecord[0].id;
	        						}
	        				}
	        				if(userId){
	        					Ext.Ajax.request({
	        						url: Fn.url("User/user?cmd=getOriPhotoUrl"),
	        						params:{
	        							userId:userId
	        						},
	        						success:function(response){
	        							var response=Ext.util.JSON.decode(response.responseText);
	        							imgUrl=response.imgOriUrl;
	        							var bigPhoto=new Ext.Window({
	        	         					closeAction:'hide',
	        	         			    	modal:true,
	        	         			    	resizable:false,
	        	         					title:"查看大图",
	        	         					height:390,
	        	         					width:400,
	        	         					padding:6,
		               			        	items:[{
		               			        		xtype: 'box', //或者xtype: 'component',   
		               			        		height: 350, //图片宽度   
		               			        		width:370, //图片高度   
		           			        		    autoEl: {   
		        	     			        	        tag: 'img',    //指定为img标签   
		        	     			        		    src: imgUrl    //指定url路径   
		           			        	        }   
		               			        	}]
	        	         				}).show();
	        						}
	        				   })
	                       }	         				
	         			},null,{delegate:"span[type='photo']"});
	         		},
	         		rowclick:function(g,row){   
						var is_show=Ext.getCmp('userList_panel_tbar_checkbox_html').getValue();//false,true
						if(is_show){
							var record= g.getStore().getAt(row);//Ext.a…y.e…d.L {id: "341", data: Object, json: Object, store: Ext.d…a.S…e.Ext.e…d.constructor}
							var data = record.data;//得到该行的所有数据Object {name: "ellen111", user_photo: "http://localhost/messageTp/Public/Data/Upload/userImg/Koala__thumb.jpg", email: "123413415@qq.com", sex: "男", register_time: Mon Jul 13 2015 17:29:07 GMT+0800 (中国标准时间)							
							var dataId = record.id;
							Ext.getCmp('userList_east_infoHtml').expand(true);
							Ext.getCmp('userList_east_infoHtml').load({url:Fn.url('User/user?cmd=rightHtml'),params:{userId:dataId},success:function(){}});
						}
					}
					//移动鼠标产生的事件
	         		//mouseover:function(){
	         			//alert(33);
	         		//}
          //,单击加载其详细信息的html页面
//        			click:function(grid,rowIndex,columnIndex,e){
        			  //var recordData = grid.getStore().getAt(rowIndex).data;
//        				var gridPanel=Ext.getCmp('App-JS-userList-Panel-grid');
//        				var rec = gridPanel.getSelectionModel();
//        				var selectedRecord=rec.grid.selModel.selections.items;
//        				if(selectedRecord.length > 0){
//        						var userId = [];
//        						for(var i=0;i<selectedRecord.length;i++){
//        							userId = selectedRecord[0].id;
//        						}
//        				}
//            			//Fn.log(userId);
//            			var sourthPanel=Ext.getCmp("index_center_south");
//            			sourthPanel.load({
//            				url:Fn.url('User/info'),
//            				params:{userId:userId}
//            			});
//         		   }
        	 },
        	 viewConfig : {
        		//True表示为自动展开/缩小列的宽度以适应grid的宽度，这样就不会出现水平的滚动条
        		forceFit : true
        	 },	
        	 bbar: new Ext.PagingToolbar({
        	        store:store,       // grid and PagingToolbar using same store
        	        displayInfo: true,
        	        //displayMsg: '显示 {0} - {1} / 共 {2} 条',
        	        pageSize: 20,
        	        prependButtons: true

        	 }),
        	 selModel:checkBox,
        	 columns:[
               checkBox,
               new Ext.grid.RowNumberer(),
               {header:'头像',dataIndex:'user_photo',width:20,
            	   renderer:function(v){
            		   imageUrl=v;
            		   return " <div id='divCenter' style='display: normal;'><span id='spanimg' type='photo' imageUrl='"+v+"'><img src='"+v+"' id='showimg'></span><div>";
                   },                   
//                 listeners : {  
//                   'click':function(v){ 
//                  	 Fn.log(v);return;
//                	     var text=imageUrl;
//                	  } 
//                 }
               },               
               //http://localhost/messageTp/Public/App/Public/Data/Upload/userImg/Penguins.jpg 
               //http://localhost/messageTp/Public/Data/Upload/userImg/Penguins.jpg 
               
               {header:'姓名',dataIndex:'name',editor:editor},
        	   {header:'性别',dataIndex:'sex',editor:combo,renderer:sex},
        	   {header:'邮箱',dataIndex:'email',editor:editor},
        	   {header:'时间',dataIndex:'register_time',editor:editor,align: 'center', renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'),editor:new Ext.form.DateField()},
               {
              	xtype:'actioncolumn',//用来在单元格里渲染一个或多个图标。 每个图标均可自定义点击处理事件。
              	width:50,
              	align:'center',
              	items:[{icon: Fn.img('icon-del.png'),
              		    tooltip: 'Delete',
              	        handler:function(grid, rowIndex, colIndex){
              	        	var rec = grid.getStore().getAt(rowIndex);
              	        	var gridPanel=Ext.getCmp("App-JS-userList-Panel-grid");
              	        	var name=document.getElementById('sessionName').getAttribute("value");
              	        	//Fn.log(rec);
              	        	var userId=rec.id;
              	        	if(userId){
                            	 Ext.Ajax.request({
                            		 method: 'post',
                            		 url: Fn.url("User/user?cmd=delUser&userId="+userId+"&userName="+name),
                            		 success:function(data){
                            			 var rec=Ext.util.JSON.decode(data.responseText);
                            			 if(rec.success==false){
                            				 Ext.Msg.alert("提示信息", "<font color='red'>权限不够</font>"); 
                            		     } 
                            			 else {            
                            				 Ext.Msg.alert("提示","删除成功!!!");
                            				 gridPanel.getStore().load();       
                                         }  
                            	     }
                                 })
                            }
              	        }	    
              	}]
               }
        	 ],
        	 store:store
          },{
        	  xtype:'panel',
        	  title:'用户信息详情',
        	  region:"east",
        	  collapsible:true,
        	  collapsed:true,
        	  split:true,
        	  width:435,
        	  layout:'fit',
        	  autoScroll:true,
        	  id:"userList_east_infoHtml",
        	  tbar:['->','-',{
        		  text:'保存',
        		  icon:Fn.img('icon-show.png'),
        		  handler:function(){
        			  var dom=Ext.getDom('orders-details-Panel-FormHtml');//getDom方法能够得到文档中的DOM节点,这是得到user视图下rightHtml的form表单的id
        			  var memo=dom.memo.value;//这是得到备注填入的值,通过name/id属性得到对应的值
        		  }
        	  }]
//          },{//若想显示下面这部分，需要把panel的layout：fit（第579行）去掉，并给north（（第761行））加上高度
//        	xtype:"panel",
//    		id:"index_center_south",
//	 		region:"south",
//	 		title:'用户详细信息',
//	 		height:300,
//	 		collapsible:true
      }]
	});
	this.panel=panel;
}